let background = null;
+function _createUserSession() {
+ // Load the calendar server. Note that we are careful about
+ // not loading any events until the user presses the clock
+ global.launch_calendar_server();
+
+ placesManager = new PlaceDisplay.PlacesManager();
+ telepathyClient = new TelepathyClient.Client();
+ automountManager = new AutomountManager.AutomountManager();
+ autorunManager = new AutorunManager.AutorunManager();
+ networkAgent = new NetworkAgent.NetworkAgent();
+}
+
+function _initRecorder() {
+ let recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
+
+ global.screen.connect('toggle-recording', function() {
+ if (recorder == null) {
+ recorder = new Shell.Recorder({ stage: global.stage });
+ }
+
+ if (recorder.is_recording()) {
+ recorder.pause();
+ } else {
+ // read the parameters from GSettings always in case they have changed
+ recorder.set_framerate(recorderSettings.get_int('framerate'));
+ recorder.set_filename('shell-%d%u-%c.' + recorderSettings.get_string('file-extension'));
+ let pipeline = recorderSettings.get_string('pipeline');
+
+ if (!pipeline.match(/^\s*$/))
+ recorder.set_pipeline(pipeline);
+ else
+ recorder.set_pipeline(null);
+
+ recorder.record();
+ }
+ });
+}
+
+function _initUserSession() {
+ _initRecorder();
+
+ keyboard.init();
+
+ global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1);
+
+ ExtensionSystem.init();
+ ExtensionSystem.loadExtensions();
+
+ let shellwm = global.window_manager;
+
+ shellwm.takeover_keybinding('panel_run_dialog');
+ shellwm.connect('keybinding::panel_run_dialog', function () {
+ getRunDialog().open();
+ });
+
+ shellwm.takeover_keybinding('panel_main_menu');
+ shellwm.connect('keybinding::panel_main_menu', function () {
+ overview.toggle();
+ });
+
+ global.display.connect('overlay-key', Lang.bind(overview, overview.toggle));
+
+}
+
function start() {
// Monkey patch utility functions into the global proxy;
// This is easier and faster than indirecting down into global
// back into sync ones.
DBus.session.flush();
- // Load the calendar server. Note that we are careful about
- // not loading any events until the user presses the clock
- global.launch_calendar_server();
-
// Ensure ShellWindowTracker and ShellAppUsage are initialized; this will
// also initialize ShellAppSystem first. ShellAppSystem
// needs to load all the .desktop files, and ShellWindowTracker
_defaultCssStylesheet = global.datadir + '/theme/gnome-shell.css';
loadTheme();
- let shellwm = global.window_manager;
- shellwm.takeover_keybinding('panel_main_menu');
- shellwm.connect('keybinding::panel_main_menu', function () {
- overview.toggle();
- });
- shellwm.takeover_keybinding('panel_run_dialog');
- shellwm.connect('keybinding::panel_run_dialog', function () {
- getRunDialog().open();
- });
-
// Set up stage hierarchy to group all UI actors under one container.
uiGroup = new Clutter.Group();
St.set_ui_root(global.stage, uiGroup);
global.stage.add_actor(uiGroup);
layoutManager = new Layout.LayoutManager();
- placesManager = new PlaceDisplay.PlacesManager();
xdndHandler = new XdndHandler.XdndHandler();
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
- overview = new Overview.Overview();
+ // This overview object is just a stub for non-user sessions
+ overview = new Overview.Overview({ isDummy: global.session_type != Shell.SessionType.USER });
magnifier = new Magnifier.Magnifier();
statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
panel = new Panel.Panel();
keyboard = new Keyboard.Keyboard();
notificationDaemon = new NotificationDaemon.NotificationDaemon();
windowAttentionHandler = new WindowAttentionHandler.WindowAttentionHandler();
- telepathyClient = new TelepathyClient.Client();
- automountManager = new AutomountManager.AutomountManager();
- autorunManager = new AutorunManager.AutorunManager();
- networkAgent = new NetworkAgent.NetworkAgent();
+ _createUserSession();
- layoutManager.init();
- keyboard.init();
- overview.init();
- statusIconDispatcher.start(messageTray.actor);
panel.startStatusArea();
- _startDate = new Date();
-
- let recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
-
- global.screen.connect('toggle-recording', function() {
- if (recorder == null) {
- recorder = new Shell.Recorder({ stage: global.stage });
- }
-
- if (recorder.is_recording()) {
- recorder.pause();
- } else {
- // read the parameters from GSettings always in case they have changed
- recorder.set_framerate(recorderSettings.get_int('framerate'));
- recorder.set_filename('shell-%d%u-%c.' + recorderSettings.get_string('file-extension'));
- let pipeline = recorderSettings.get_string('pipeline');
-
- if (!pipeline.match(/^\s*$/))
- recorder.set_pipeline(pipeline);
- else
- recorder.set_pipeline(null);
-
- recorder.record();
- }
- });
+ keyboard.init();
+ overview.init();
- global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1);
+ if (global.session_type == Shell.SessionType.USER)
+ _initUserSession();
+ statusIconDispatcher.start(messageTray.actor);
// Provide the bus object for gnome-session to
// initiate logouts.
// Attempt to become a PolicyKit authentication agent
PolkitAuthenticationAgent.init()
- ExtensionSystem.init();
- ExtensionSystem.loadExtensions();
-
- global.display.connect('overlay-key', Lang.bind(overview, overview.toggle));
+ _startDate = new Date();
global.stage.connect('captured-event', _globalKeyPressHandler);
return true;
}
+ if (action == Meta.KeyBindingAction.SWITCH_PANELS) {
+ ctrlAltTabManager.popup(modifierState & Clutter.ModifierType.SHIFT_MASK);
+ return true;
+ }
+
+ // None of the other bindings are relevant outside of the user's session
+ if (global.session_type != Shell.SessionType.USER)
+ return false;
+
switch (action) {
// left/right would effectively act as synonyms for up/down if we enabled them;
// but that could be considered confusing; we also disable them in the main view.
case Meta.KeyBindingAction.PANEL_MAIN_MENU:
overview.hide();
return true;
- case Meta.KeyBindingAction.SWITCH_PANELS:
- ctrlAltTabManager.popup(modifierState & Clutter.ModifierType.SHIFT_MASK);
- return true;
}
return false;
this.actor.connect('allocate', Lang.bind(this, this._allocate));
/* Button on the left side of the panel. */
- this._activitiesButton = new ActivitiesButton();
- this._activities = this._activitiesButton.actor;
- this._leftBox.add(this._activities);
-
- // The activities button has a pretend menu, so as to integrate
- // more cleanly with the rest of the panel
- this._menus.addMenu(this._activitiesButton.menu);
-
- this._appMenu = new AppMenuButton();
- this._leftBox.add(this._appMenu.actor);
-
- this._menus.addMenu(this._appMenu.menu);
+ if (global.session_type == Shell.SessionType.USER) {
+ this._activitiesButton = new ActivitiesButton();
+ this._activities = this._activitiesButton.actor;
+ this._leftBox.add(this._activities);
+
+ // The activities button has a pretend menu, so as to integrate
+ // more cleanly with the rest of the panel
+ this._menus.addMenu(this._activitiesButton.menu);
+
+ this._appMenu = new AppMenuButton();
+ this._leftBox.add(this._appMenu.actor);
+ this._menus.addMenu(this._appMenu.menu);
+ }
/* center */
- this._dateMenu = new DateMenu.DateMenuButton();
+ if (global.session_type == Shell.SessionType.USER)
+ this._dateMenu = new DateMenu.DateMenuButton({ showEvents: true });
+ else
+ this._dateMenu = new DateMenu.DateMenuButton({ showEvents: false });
this._centerBox.add(this._dateMenu.actor, { y_fill: true });
this._menus.addMenu(this._dateMenu.menu);
this._rightBox.add(this._trayBox);
this._rightBox.add(this._statusBox);
- this._userMenu = new StatusMenu.StatusMenuButton();
- this._userMenu.actor.name = 'panelStatus';
- this._rightBox.add(this._userMenu.actor);
+ if (global.session_type == Shell.SessionType.USER) {
+ this._userMenu = new StatusMenu.StatusMenuButton();
+ this._userMenu.actor.name = 'panelStatus';
+ this._rightBox.add(this._userMenu.actor);
+ }
Main.statusIconDispatcher.connect('status-icon-added', Lang.bind(this, this._onTrayIconAdded));
Main.statusIconDispatcher.connect('status-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
// PopupMenuManager depends on menus being added in order for
// keyboard navigation
- this._menus.addMenu(this._userMenu.menu);
+ if (this._userMenu)
+ this._menus.addMenu(this._userMenu.menu);
},
addToStatusArea: function(role, indicator, position) {